package acm.pta5;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;

public class T1_4 {
    public static void main(String[] args) throws IOException {
        BufferedReader in =new BufferedReader(new InputStreamReader(System.in));
        int k=Integer.parseInt(in.readLine())+1;
        Map<String,String> map=new HashMap<>();
        map.put("ChuiZi","Bu");
        map.put("JianDao","ChuiZi");
        map.put("Bu","JianDao");
        int i=1;
        while (in.ready()){
            String s = in.readLine();
            if ("End".equals(s)){
                return;
            }
            if (i++%k==0){
                System.out.println(s);
            }else {
                System.out.println(map.get(s));
            }
        }
    }
}
